home *** CD-ROM | disk | FTP | other *** search
- /*
- FILE: Journal cdev.h
-
- Include file for the Journal cdev.
-
- This has the class definition and constants used by
- the journal cdev.
-
- */
-
- #include <cdev.h>
- #include <Global.h>
-
- /* state informaiont resource */
-
- #define STATE_RES_TYPE 'JrnS'
- #define STATE_RES_ID 1000
-
- typedef struct JournalState {
- int eventFlags ; /* For bitmasks see journalDriverInclude.h */
- int recording ;
- int hasFile ;
- int driverRefNum ;
- short vRefNum ;
- long dirID ;
- OSType creator ;
- Str63 fName ;
- } JrnlState, *P_JrnlState ;
-
-
-
- /* cdev subclass */
-
- struct Journal : cdev {
-
- /* instance variables */
-
- Handle journalState ; /* Handle to JrnlState structure */
-
- /* overridden methods */
-
- void Init(void);
- void Close(void);
- void ItemHit(int theItem);
-
- void DoFileButton(void) ;
- void DoStartStopButton(void) ;
- void SetButtonState(Boolean activate) ;
- void DoSetFileCreator(void) ;
-
- void DoDriverStuff(Boolean isStart) ;
-
- void DoHiliteControl(int theItem, Boolean theHilite) ;
- void DoSetControl(int theItem, int theValue) ;
- };
-
- /* useful definitions */
-
-
- #define CHECK_ON 1
- #define CHECK_OFF 0
-
- #define CONTROL_ACTIVE 0
- #define CONTROL_INACTIVE 255
-
- /* dialog item numbers */
-
- #define FILE_BUTTON 1
- #define TIME_STAMP_CHECK 2
- #define START_STOP_BUTTON 3
- #define INSTALLED_STRING 4
- #define FILE_CREATOR_BUTTON 5
- #define FILE_CREATOR_STRING 6
-
- #define START_STRING "\pStart"
- #define STOP_STRING "\pStop"
- #define FILE_PROMPT "\pSave journaling information in file:"
- #define DEFAULT_FILE_NAME "\pJournal File"
- #define DEFAULT_FILE_CREATOR 'MSWD'
- #define CREATOR_PROMPT "\pSelect the application to use for the journal file type:"
-
-
- /* stuff to synchronize between the INIT and the cdev
- The flag is set to 1 if the driver is installed, 0 otherwise.
- The cdev checks the value of the flag to see if it can access
- the driver
- */
-
- #define JRNL_DRIVER_FLAG_TYPE 'JrnF' /* resource type of flag */
- #define JRNL_DRIVER_FLAG_ID 1000 /* resource ID of flag */
-